package com.qumitech.visualnovel.service.channel.impl;

import com.qumitech.visualnovel.datasource.console.ChannelCPCRechargeDataMapper;
import com.qumitech.visualnovel.datasource.console.ChannelCPCStatisticsMapper;
import com.qumitech.visualnovel.model.dao.console.ChannelCPCRechargeData;
import com.qumitech.visualnovel.model.dao.console.ChannelCPCStatistics;
import com.qumitech.visualnovel.service.channel.ChannelCPCDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * ChannelCPCDataService实现
 *
 * @author zhangbc
 * @version 1.0.0
 * @date 2020/8/11 19:15
 **/
@Service
public class ChannelCPCDataServiceImpl implements ChannelCPCDataService {

    @Autowired
    ChannelCPCStatisticsMapper statisticsMapper;

    @Autowired
    ChannelCPCRechargeDataMapper rechargeDataMapper;

    @Override
    public List<ChannelCPCStatistics> ChannelCPCDataList(String startTime, String endTime, String channel, String appId,
                                                         int offset, int pageSize, String orderType, String orderBy) {
        return statisticsMapper.getList(startTime, endTime, channel, appId, offset, pageSize, orderType, orderBy);
    }

    @Override
    public int ChannelCPCDataListCount(String startTime, String endTime, String channel, String appId) {
        return statisticsMapper.getCount(startTime, endTime, channel, appId);
    }

    @Override
    public List<ChannelCPCRechargeData> ChannelCPCRechargeList(String startTime, String endTime, String channel,
                                                               String appId, int offset, int pageSize,
                                                               String orderType, String orderBy) {
        return rechargeDataMapper.getList(startTime, endTime, channel, appId, offset, pageSize, orderType, orderBy);
    }

    @Override
    public int ChannelCPCRechargeCount(String startTime, String endTime, String channel, String appId) {
        return rechargeDataMapper.getCount(startTime, endTime, channel, appId);
    }
}
